<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
	</head>

	<body>
		<ul id="mvlist" class="mui-table-view">
			<li class="mui-table-view-cell mui-hidden">cared
				<div id="M_Toggle" class="mui-switch mui-active">
					<div class="mui-switch-handle"></div>
				</div>
			</li>
			<li class="mui-table-view-cell mui-media">
				<a href="#">
					<img class="mui-media-object mui-pull-left" src="http://dcloudio.github.io/mui/assets/img/shuijiao.jpg">
					<div class="mui-media-body">
						幸福
						<p class='mui-ellipsis'>能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
					</div>
				</a>
			</li>
		</ul>
		<script>
			mui.ajax("http://www.liwbiy.com:8080/Leisurelife/dealcmd", {
				type: "post",
				data: {
					cmd: "101"
				},
				success: function(data) {
					var json = eval('(' + data + ')');
					var movies = json.list;
					var ulE = document.getElementById("mvlist");
					console.log("长度" + movies.length);
					for (var i = 0; i < movies.length; i++) {
						console.log(movies[i].name);
						var liE = document.createElement("li");
						liE.className = "mui-table-view-cell mui-media";
						var aE = document.createElement("a");
						aE.href = "#";
						
						var imgE = document.createElement("img");
						imgE.className = "mui-media-object mui-pull-left";
						
						var divE = document.createElement("div");
						divE.className = "mui-media-body";
						divE.innerHTML = movies[i].name;
						
						var pTypeE = document.createElement("p");
						pTypeE.className = "mui-ellipsis";
						pTypeE.innerHTML = movies[i].type;
						
						var pTimeE = document.createElement("p");
						pTimeE.className = "mui-ellipsis";
						pTimeE.innerHTML = movies[i].time;
						
						var pPlayerE = document.createElement("p");
						pPlayerE.className = "mui-ellipsis";
						pPlayerE.innerHTML = movies[i].player;
						//添加元素
						divE.appendChild(pTypeE);
						divE.appendChild(pTimeE);
						divE.appendChild(pPlayerE);
						aE.appendChild(imgE);
						aE.appendChild(divE);
						liE.appendChild(aE);
						ulE.appendChild(liE);
					}
				},
				error: function() {
					mui.alert("访问服务出错");
				}
			})
		</script>
	</body>

</html>